package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 商品对象 product
 *
 * @author ruoyi
 * @date 2022-05-03
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "product实体", description = "product实体")
public class Product implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 商品表主键id */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
    private String id;

    /** 商品名 */
    @Excel(name = "商品名")
    @ApiModelProperty(value = "商品名")
    private String name;

    /** 商品简介 */
    @Excel(name = "商品简介")
    @ApiModelProperty(value = "intro")
    private String intro;

    /** 关联分类id */
    @Excel(name = "关联分类id")
    @ApiModelProperty(value = "categoryId")
    private Long categoryId;

    /** 商品主图 */
    @Excel(name = "商品主图")
    @ApiModelProperty(value = "商品主图")
    private String cover;

    /** 商品详情 */
    @Excel(name = "商品详情")
    @ApiModelProperty(value = "商品详情")
    private String detail;

    /** 商品价格 */
    @Excel(name = "商品价格")
    @ApiModelProperty(value = "商品价格")
    private Double originalPrice;

    /** 实际价格 */
    @Excel(name = "实际价格")
    @ApiModelProperty(value = "实际价格")
    private Double price;

    /** 库存 */
    @Excel(name = "库存")
    @ApiModelProperty(value = "库存")
    private Integer stock;

    /** 商品上架状态（0：下架，1：上架） */
    @Excel(name = "商品上架状态", readConverterExp = "0=下架,1=上架")
     @ApiModelProperty(value = "商品上架状态")
    private Integer status;

    /** 是否是热门产品（0：是，1：否） */
    @Excel(name = "是否是热门产品", readConverterExp = "0=是,1=否")
    @ApiModelProperty(value = "是否是热门产品")
    private Integer isHot;

    @Excel(name = "创建时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @Excel(name = "类型", readConverterExp = "1=售卖,2=充值,9=其他")
    @ApiModelProperty(value = "类型")
    private String type;

}
